
EnergyUiInfo = function(adapterUtils, parentW, parentH, maxEnergyNum) {
    this.maxEnergyNum = maxEnergyNum;
    this.nowEnergy = 5;

    this.offsetW = adapterUtils.getSize(20);
    this.offsetH = 0;
    this.w = parentW - this.offsetW*2;
    this.h = parentH - this.offsetH*2;
    this.x = this.offsetW;
    this.y = this.offsetH;
    this.cornerRadius = adapterUtils.getSize(8);

    this.energySpace = adapterUtils.getSize(4);
    this.energyW = Math.floor((this.w - (this.maxEnergyNum+1)*this.energySpace) / this.maxEnergyNum);
    this.energyH = Math.floor((this.h - this.energySpace*2));

    this.getEnergyRect = function(index) {
        var x = this.x + index * this.energySpace + (index-1)*this.energyW;
        var y = this.y + this.energySpace;
        return new Rect(x, y, this.energyW, this.energyH);
    }
}
